package com.project.modules.redEnvelope.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.project.modules.redEnvelope.mapper.TblRecordMapper;
import com.project.modules.redEnvelope.model.TblRecord;
import com.project.modules.redEnvelope.service.TblRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * Service 实现类
 *
 * @author Qing2514
 */
@Slf4j
@Service
public class TblRecordServiceImpl extends ServiceImpl<TblRecordMapper, TblRecord> implements TblRecordService {

    @Override
    public Page<TblRecord> getPage(Long keyword, Integer pageSize, Integer pageNum) {
        Page<TblRecord> page = new Page<>(pageNum, pageSize);
        LambdaQueryWrapper<TblRecord> wrapper = new LambdaQueryWrapper<>();
        wrapper.like(TblRecord::getId, keyword);
        return page(page, wrapper);
    }

}
